package com.fmx.BookStore.domain;

import com.fmx.BookStore.core.domain.BaseEntity;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Component
public class Book extends BaseEntity {
    //图书ID
    private Long bookId;
    //图书名字
    private String bookName;
    //作者
    private String writer;
    //ISBN码
    private String isbn;
    //价格
    private BigDecimal price;
    //销量
    private Long saleNum;
    //类别
    private Category category;

    private Long categoryId;

    public Book() {
    }

    public Book(Long bookId, String bookName, String writer, String isbn, BigDecimal price, Long saleNum, Category category, Long categoryId) {
        this.bookId = bookId;
        this.bookName = bookName;
        this.writer = writer;
        this.isbn = isbn;
        this.price = price;
        this.saleNum = saleNum;
        this.category = category;
        this.categoryId = categoryId;
    }

    public Long getBookId() {
        return bookId;
    }

    public void setBookId(Long bookId) {
        this.bookId = bookId;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getWriter() {
        return writer;
    }

    public void setWriter(String writer) {
        this.writer = writer;
    }

    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Long getSaleNum() {
        return saleNum;
    }

    public void setSaleNum(Long saleNum) {
        this.saleNum = saleNum;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookId=" + bookId +
                ", bookName='" + bookName + '\'' +
                ", writer='" + writer + '\'' +
                ", isbn='" + isbn + '\'' +
                ", price=" + price +
                ", saleNum=" + saleNum +
                ", category=" + category +
                ", categoryId=" + categoryId +
                '}';
    }
}
